package oop.day08;

public class Student extends Person implements Swim{
    // 这种分类的实物具有共同的属性特征
   // String name;
   // int age;
    String clazzName;

    Student(){
        super();
        super.name = "Student";
        super.eat();
        this.age=1;
    }
    Student(String name, int age){
        this();
        this.study();
        this.age=age;
        this.name=name;
    }
    Student(String name, int age, String clazzName) {
        this.name = name;
        this.age = age;
        this.clazzName = clazzName;
    }

    // 这种类型的实物具有共同的功能
    public void study(){
        System.out.println("Student study");
    }

    public void sleep(){
        System.out.println("Student sleep");
    }


    @Override
    public void swim() {
        System.out.println("Student.swim");
    }

    @Override
    public String toString() {
        return "Student [name=" + name + ", age=" + age + ", clazzName=" + clazzName + "]";
    }
}
